﻿@{
    ViewBag.Title = "_NewProducts";
}
@using System.Text;
@model EC_ASS.Models.BigModel

<h4>Áo Mới <a href="/Home/TShirt" class="btn" style="float: right;">Xem thêm</a></h4>
<div class="row">
    <ul class="portfolio-list" data-sort-id="portfolio">
        @foreach(var item in Model.PAProduct)
        {
            <li class="span2 isotope-item">
                <div class="portfolio-item thumbnail">
                    <a href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info">
                        <img alt="" src="@Url.Content("~/" + @item.Picture)" />
                        <span class="thumb-info-title">
                            <span class="thumb-info-inner">@item.Name</span>
                            <span class="thumb-info-type">@item.Price VNĐ</span>
                        </span>
                        <span class="thumb-info-action">
                            <span title="Xem chi tiết" href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info-action-icon"><i class="icon-link"></i></span>
                        </span>
                    </a>
                </div>
            </li>
            }
    </ul>
</div>
<h4>Quần mới <a href="/Home/Pants" class="btn" style="float: right;">Xem thêm</a></h4>
<div class="row">
    <ul class="portfolio-list" data-sort-id="portfolio">
        @foreach(var item in Model.PQProduct)
        {
            <li class="span2 isotope-item">
                <div class="portfolio-item thumbnail">
                    <a href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info">
                        <img alt="" src="@Url.Content("~/" + @item.Picture)" />
                        <span class="thumb-info-title">
                            <span class="thumb-info-inner">@item.Name</span>
                            <span class="thumb-info-type">@item.Price VNĐ</span>
                        </span>
                        <span class="thumb-info-action">
                            <span title="Xem chi tiết" href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info-action-icon"><i class="icon-link"></i></span>
                        </span>
                    </a>
                </div>
            </li>
            }
    </ul>
</div>
<h4>Giày mới <a href="/Home/Shoes" class="btn" style="float: right;">Xem thêm</a></h4>
<div class="row">
    <ul class="portfolio-list" data-sort-id="portfolio">
        @foreach(var item in Model.PGProduct)
        {
            <li class="span2 isotope-item">
                <div class="portfolio-item thumbnail">
                    <a href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info">
                        <img alt="" src="@Url.Content("~/" + @item.Picture)" />
                        <span class="thumb-info-title">
                            <span class="thumb-info-inner">@item.Name</span>
                            <span class="thumb-info-type">@item.Price VNĐ</span>
                        </span>
                        <span class="thumb-info-action">
                            <span title="Xem chi tiết" href="/Product/@item.ID/@ToUrlName(item.Name)/Info" class="thumb-info-action-icon"><i class="icon-link"></i></span>
                        </span>
                    </a>
                </div>
            </li>
            }
    </ul>
</div>
@*<h4>Hiển thị bằng thumbnail bootstrap <a href="#" class="btn" style="float: right;">Xem thêm</a></h4>
<div class="row" style="margin-bottom: 50px;">
    <ul class="portfolio-list sort-destination" data-sort-id="portfolio">
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <li class="span2">
            <div class="thumbnail">
                <img alt="" src="@Url.Content("~/img/product/g6.jpg")" />
                <div class="caption">
                    <Strong>Thumbnail label</Strong>
                    <div class="btn-toolbar">
                        <div class="btn-group">
                            <a class="btn" href="#">Xem</a>
                            <a class="btn" href="#">Đặt mua</a>
                        </div>
                    </div>
                </div>
            </div>
        </li>
    </ul>
</div>*@
@functions {
    string ToUrlName(string name)
    {
        string stFormD = name.Normalize(NormalizationForm.FormD);
        StringBuilder sb = new StringBuilder();
        for (int ich = 0; ich < stFormD.Length; ich++)
        {
            System.Globalization.UnicodeCategory uc = System.Globalization.CharUnicodeInfo.GetUnicodeCategory(stFormD[ich]);
            if (uc != System.Globalization.UnicodeCategory.NonSpacingMark)
            {
                sb.Append(stFormD[ich]);
            }
        }
        sb = sb.Replace('Đ', 'D');
        sb = sb.Replace('đ', 'd');
        return (sb.ToString().Normalize(NormalizationForm.FormD).ToUpperInvariant().Trim().Replace(" ", "-"));
    }
}

